import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "../component" as C
import "qrc:/component/ZGlobal.js" as Global
C.ZModelRect{
    id: rootStopPage
    anchors.centerIn: parent
    color: "#F3F7FB"
    radius: 10
    width:800
    height:518
    visible: false
    Theme { id: theme }
    Image {
        x: 40
        y: 40
        source: "qrc:/assets/greenrect.png"
        width: 16
        height: 28
        fillMode: Image.PreserveAspectFit
    }

    Label{
        x:68
        y:36
        Text{
            text: "批次备注"
            font.pixelSize: 28
            color: "#333333"
            font.bold: true
        }
    }

    Label{
        x:40
        y:108
        Text{
            text: "备注信息"
            font.pixelSize: 24
            color: "#333333"
        }
    }

    Rectangle {
        id: zInputImage
        x: 40
        y: 151
        width: 721
        height: 220
        border.width: 2
        border.color: "#D1D3D8"

        property alias text: textField.text
        property alias placeholderText: textField.placeholderText
        //signal textChanged
        TextArea{
            id: textField
            leftPadding:3
            verticalAlignment: Text.AlignTop
            anchors.fill: parent
            wrapMode: Text.WrapAnywhere
            focus: true
            font.pixelSize: 24
            placeholderText: "请输入备注信息"
            background: null
            // onTextChanged: {
            //     console.log("onTextChanged:", text)
            //     //zInputImage.textChanged();
            // }
        }
    }


    Label{
        x:40
        y:380

        Text{
            id: errInfo
            text: ""
            font.pixelSize: 20
            color: "red"
            visible: false
        }
    }

    C.ZButton{
        x: 328
        y: 410
        text: "取消"
        onClicked: {
            // console.log(">>>>>>>>>>>>")
            rootStopPage.visible=false;
            rootMainPage.hideMask("cancel");
        }
    }


    C.ZButton{
        x: 560
        y: 410
        text: "确定"
        color: "#178FCD"
        fontColor: "white"
        onClicked: {
            errInfo.text="";
            batchInfo.updateBatch(textField.text)
            rootStopPage.visible=false;
            rootMainPage.hideMask("ok");
        }
    }
}

